package com.acwing.partition3;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/2/13 11:26
 */
public class AC244谜一样的牛 {

    private static final int N = 100010;
    private static int[] h = new int[N], tr = new int[N], ans = new int[N];
    private static int n = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = Integer.parseInt(reader.readLine());
        for (int i = 2; i <= n; i++) h[i] = Integer.parseInt(reader.readLine());
        //初始化树状数组
        for (int i = 1; i <= n; i++) add(i, 1);
        for (int i = n; i >= 1; i--) {
            int k = h[i] + 1;
            int l = 1, r = n;
            while (l < r) {
                int mid = l + r >> 1;
                if (ask(mid) >= k) r = mid;
                else l = mid + 1;
            }
            ans[i] = l;
            //在l这个位置-1，表示这头牛的身高已经使用过
            add(l, -1);
        }
        for (int i = 1; i <= n; i++) writer.write(ans[i] + "\n");
        writer.flush();
    }

    private static int ask(int x) {
        int res = 0;
        for (int i = x; i != 0; i -= lowbit(i)) res += tr[i];
        return res;
    }

    private static void add(int x, int k) {
        for (int i = x; i <= n; i += lowbit(i)) tr[i] += k;
    }

    private static int lowbit(int x) {
        return x & -x;
    }
}
